package com.example.util.im

import android.os.Message
import java.util.*

/**
 * 消息观察者
 * @author  chaohaipeng  on 2018/7/17.
 */
class MessageEvent : Observable() {
    private object mHolder {
        val instance = MessageEvent()
    }
    companion object {
        fun getInstance(): MessageEvent {
            return mHolder.instance
        }
    }

    /**
     * 主动通知新消息
     */
    fun onNewMessage(message: Message) {
        setChanged()
        notifyObservers(message)
    }


}